Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: None padding order, adding otherjets in Wc WF #60

Closed
wants to merge 2 commits into from

Conversation

mondalspandan
Copy link
Contributor

No description provided.

Copy link
Collaborator

@Ming-Yan Ming-Yan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mondalspandan thank you very much for the changes and also find out the type bug!

Generally I have one comment and two question
💬 I would suggest all the boolean should do ak.fill_none(boolean,False) to remove None values
❓ I had the impression you want to store the flag (isMuJet) in the tree instead of the skimmed object(MuonJet, OtherJets), is this still the case?
❓ Did you plan to include the LHE NJet cut for the jet split sample? I have an idea the Njet split can be triggered when checking through all the dataset in runner step.

Comment on lines +122 to +124
jet_sel = jet_id(events, self._campaign) & (
ak.all(events.Jet.metric_table(iso_muon) > 0.5, axis=2)
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the additional ak.fill_none for the selection to avoid None in the jet selection. (just to be sure None filtered out 😉 )

)
)
mujetsel = (
(ak.all(event_jet.metric_table(soft_muon) <= 0.4, axis=2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mask_identity=True should be there to avoid None events pass True criteria.
The ak.fill_none(mujetsel,False,axis=-1) then remove None, this cut can be proceed anywhere. (Then you don't need mujetsel2)

@@ -518,7 +513,7 @@ def process_shift(self, events, shift_name):
out_branch,
np.where(
(out_branch == "SoftMuon")
| (out_branch == "MuonJet")
# | (out_branch == "MuonJet")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I understand correctly you want to store PFcands in the MuonJet collection so you commented out?(also OtherJets also not included)

@@ -528,7 +523,7 @@ def process_shift(self, events, shift_name):
"Muon",
"Jet",
"SoftMuon",
"MuonJet",
# "MuonJet",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kinematics variables will not save, is this done intentionally?

@@ -544,6 +539,7 @@ def process_shift(self, events, shift_name):
out_branch, ["Jet_btagDeep*", "Jet_DeepJet*", "PFCands_*", "SV_*"]
)
# write to root files
print("Branches to write:", out_branch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the check you want to keep when running the code?
Indeed the out_branch also contains some regexp which not really returns full variable. Maybe would be interesting to check with fout["Events"].fields for check all the entries

pruned_ev["MuonJet"] = smuon_jet
pruned_ev["SoftMuon"] = ssmu
pruned_ev["OtherJets"] = sotherjets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still want to store the jet flag instead of collections on MuonJet & OtherJet? The mujetsel can still considered as a flag in the Jet variables

@@ -523,7 +514,7 @@ def process_shift(self, events, shift_name):
"Muon",
"Jet",
"SoftMuon",
"MuonJet",
# "MuonJet",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kinematics variables will not save, is this done intentionally?

@@ -539,6 +530,7 @@ def process_shift(self, events, shift_name):
out_branch, ["Jet_btagDeep*", "Jet_DeepJet*", "PFCands_*", "SV_*"]
)
# write to root files
print("Branches to write:", out_branch)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the check you want to keep when running the code?
Indeed the out_branch also contains some regexp which not really returns full variable. Maybe would be interesting to check with fout["Events"].fields for check all the entries

Comment on lines -516 to +507
| (out_branch == "MuonJet")
# | (out_branch == "MuonJet")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did I understand correctly you want to store PFcands in the MuonJet collection so you commented out?(also OtherJets also not included)

Comment on lines +477 to +480
pruned_ev["Jet"] = sjets
pruned_ev["Muon"] = shmu
pruned_ev["MuonJet"] = smuon_jet
pruned_ev["OtherJets"] = sotherjets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still want to store the jet flag instead of collections on MuonJet & OtherJet? The mujetsel can still considered as a flag in the Jet variables

This was referenced Aug 23, 2023
@Ming-Yan Ming-Yan changed the title Fixing None padding order, adding otherjets in Wc WF Fix: None padding order, adding otherjets in Wc WF Sep 5, 2023
@demuller
Copy link
Contributor

@mondalspandan and @Ming-Yan what is the current status of this PR?

@mondalspandan
Copy link
Contributor Author

Hi, I stopped working on it because my base branch diverged. Ming-Yan made a PR after this. @Ming-Yan Did you also fix the None padding issue or is it still present in the master?

@Ming-Yan
Copy link
Collaborator

Hi, I stopped working on it because my base branch diverged. Ming-Yan made a PR after this. @Ming-Yan Did you also fix the None padding issue or is it still present in the master?

Hi @mondalspandan , indeed I fix the padding issue in the master PR.

@mondalspandan
Copy link
Contributor Author

Then I think this PR can be deleted :)

@Ming-Yan Ming-Yan closed this Sep 22, 2023
@Ming-Yan Ming-Yan deleted the spandan_brux branch July 25, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants